package mj.scott.controller;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import mj.scott.common.Result;
import mj.scott.pojo.dto.EmployeeLoginDTO;
import mj.scott.service.IEmployeeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 商家登录接口
 * @author Scott
 * @since 2025-08-15
 */
@RestController
@Api(tags = "商家账号管理")
@RequestMapping("/employee")
public class EmployeeController {
    @Autowired
    private IEmployeeService employeeService;

    /**
     * 用户登录接口
     * @param employeeLoginDTO 包含用户名和密码的登录信息
     * @return 登录结果
     */
    @PostMapping("/login")
    @ApiOperation("商家登录接口")
    public Result login(@RequestBody EmployeeLoginDTO employeeLoginDTO) {
        return employeeService.login(employeeLoginDTO);
    }
}
